add Connectivity Listener
Registers a ConnectivityListener to receive notifications about changes in the player's internet connectivity status.
This listener is invoked when the player detects a change in its ability to connect to the internet (e.g., transitioning from offline to online, or vice versa). This is the preferred way to react to connectivity changes, rather than repeatedly polling isConnected.
It is crucial to call removeConnectivityListener when the listener is no longer needed (e.g., when a component is destroyed) to prevent memory leaks.
Parameters
listener
The non-null ConnectivityListener instance to register.
See also
Throws
if listener
is null.